package cj.web.admin.dao;
/*
 *  
 *  
*/
import java.util.List;
import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import net.paoding.rose.jade.annotation.SQLParam;
import cj.web.admin.domain.SysInfor;

/**
 * 
 * @author 
 *
 */
@DAO
public interface SysInforDAO{
	
	@SQL("SELECT * FROM SysInfor WHERE deleteFlag=1 AND userId=:t.userId #if(:t.name != null){ and name like '%##(:t.name)%' } ORDER BY createAT DESC LIMIT :t.start,:t.length ")
    List<SysInfor> query(@SQLParam("t") SysInfor sysInfor);
	
	@SQL("SELECT count(1) FROM SysInfor WHERE deleteFlag=1 AND userId=:t.userId #if(:t.name != null){ and name like '%##(:t.name)%' } ORDER BY createAT DESC ")
    int querySize(@SQLParam("t") SysInfor sysInfor);
    
    @SQL("SELECT * FROM SysInfor where id=:1")
    SysInfor queryById(int id);
    
    @SQL("INSERT INTO SysInfor (userId,name,descs,deleteFlag,createUser,createAT) VALUES (:t.userId,:t.name,:t.descs,1,:t.createUser,now())")
    void create(@SQLParam("t") SysInfor sysInfor);
}